home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_2 / tridv220.zip / EXAMPLE.PAS < prev    next >
Pascal/Delphi Source File  |  1991-06-11  |  5KB  |  153 lines

  1. program example;
  2.  
  3. {****************************************************************************
  4.  *                                                                          *
  5.  *  This is a very basic program that will show you a few of the VERY many  *
  6.  *  functions available to the programmer using the TriDoor package.        *
  7.  *                                                                          *
  8.  *  To most effectively use and understand the unit, you should invest the  *
  9.  *  time to read the manual included in the release and then experiment     *
  10.  *  with the unit in your own programs.                                     *
  11.  *                                                                          *
  12.  ****************************************************************************}
  13.  
  14. uses
  15.   crt,
  16.   tridr55u;            { The TriDoor unit must come after the CRT unit. }
  17.  
  18. {* * * * * * * *}
  19.  
  20. procedure example_getinput;
  21.  
  22. {* This procedure will show some of the getinput() function capabilities
  23.    and features.                                                          *}
  24.  
  25. var
  26.   tempin : string;   {* input string used for this procedure *}
  27.  
  28. begin {* example_getinput *}
  29.  
  30.   clearcom;
  31.  
  32.   print('This is an example of some of TriDoor''s input features.  All these||');
  33.   print('capabilities are built in and very easy to use.||');
  34.   print('-------------------------------------------------------------------||||');
  35.   
  36.   print('  This is an example of standard input -||');
  37.   print('  What do you think of TriDoor?||');
  38.   print('  -> ');
  39.   tempin := getinput(80);
  40.   print('||||||');
  41.  
  42.   print('  This is an example of limited input -||');
  43.   print('  Enter your name (10 Characters Max) : ');
  44.   tempin := getinput(10);
  45.   print('||||||');
  46.  
  47.   print('  This is an example of coded and limited input -||');
  48.   print('  Enter your password (12 Characters Max ) : ');
  49.   code := true;
  50.   tempin := getinput(12);
  51.   print('  You entered the password : '+tempin+'.||||||');
  52.  
  53.   print('  This is an example of limited and upper-cased input -||');
  54.   print('                                   [------------]||');
  55.   print('  Enter name of file to download :  ');
  56.   caps := true;
  57.   tempin := getinput(12);
  58.   print('||||||');
  59.  
  60.   print('Press any key to continue : ');
  61.   tempin[1] := getkey;
  62.  
  63. end;  {* example_getinput *}
  64.  
  65. {* * * * * * * *}
  66.  
  67. procedure example_ANSI;
  68.  
  69. {* This is an example of some ANSI screen controls that are built right
  70.    into the TriDoor program.  These screen controls were used to make
  71.    TriUser- a QuickBBS On-Line ANSI Utilizing User Editor.               *}
  72.  
  73. var
  74.   tempin : string;   {* input string used for this procedure *}
  75.  
  76. begin {* example_ANSI *}
  77.  
  78.   clearcom;
  79.  
  80.   ancolor(0,INTENSITY,BLUE,BLACK);
  81.   print('This ');
  82.   ancolor(0,INTENSITY,YELLOW,BLACK);
  83.   print('is ');
  84.   ancolor(0,INTENSITY,GREEN,BLACK);
  85.   print('an ');
  86.   ancolor(0,INTENSITY,MAGENTA,BLACK);
  87.   print('example ');
  88.   ancolor(0,0,CYAN,BLACK);
  89.   print('of ');
  90.   ancolor(0,0,RED,BLACK);
  91.   print('ANSI');
  92.   ancolor(BLINK,INTENSITY,CYAN,BLACK);
  93.   print('!');
  94.  
  95.   angotoxy(10,10);
  96.   ancolor(BLINK,INTENSITY,CYAN,BLUE);
  97.   print('ANSI CONTROLS CAN BE FUN!!!');
  98.  
  99.   angotoxy(1,20);
  100.   ancolor(0,0,WHITE,BLACK);
  101.   print('Press any key to continue : ');
  102.   tempin[1] := getkey;
  103.  
  104. end;  {* example_ANSI *}
  105.  
  106. {* * * * * * * *}
  107.  
  108. procedure wrapup;
  109.  
  110. {* This is simply an ending procedure to the program. *}
  111.  
  112. begin {* wrapup *}
  113.  
  114.   clearcom;
  115.  
  116.   print('||||');
  117.   print('      Well, that is about all  there is for  THIS particular  program BUT||');
  118.   print('    as I pointed out earlier, the  possibilities are many  and due to the||');
  119.   print('    very loose interface structure of the unit the limits are few.||||');
  120.   
  121.   print('      If you have any problems or questions, please feel free to call our||');
  122.   print('    BBS or drop us a  letter at  the address listed in  the documentation||');
  123.   print('    under the heading of "Who to Contact".||||');
  124.  
  125.   print('      We hope you find  TriDoor as useful, pliable and easy to use  as we||');
  126.   print('    have.  Good luck and happy programming!||||||');
  127.  
  128. end;  {* wrapup *}
  129.  
  130. {* * * * * * * *}
  131.  
  132. begin {* main procedure *}
  133.  
  134.   clrscr;
  135.  
  136.   if ( readquick ) then      {* if DORINFO1.DEF exists (and was read)... *}
  137.     begin
  138.  
  139.       if ( setuptri ) then
  140.         begin
  141.  
  142.           example_getinput;
  143.           example_ANSI;
  144.           wrapup;
  145.  
  146.         end
  147.       else writeln('Error : TriDoor was inable to set-up COMM port.',chr(7));
  148.  
  149.     end
  150.   else writeln('Error : File DORINFO1.DEF not found.',chr(7));
  151.  
  152.  
  153. end.  {* main procedure *}